home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 October / CMCD1004.ISO / Software / Freeware / Utilitare / DesktopSidebar / Plugins / NotesEditor.DSPACKAGE / Source Code / CPropertiesDlg.cs < prev    next >
Encoding:
Text File  |  2004-07-08  |  14.9 KB  |  404 lines

  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. using System.Resources;
  7. using DesktopSidebar;
  8.  
  9.  
  10. namespace NotesEditor
  11. {
  12.     
  13.     public class CPropertiesDlg : System.Windows.Forms.Form
  14.     {
  15.         private System.Windows.Forms.CheckBox chkbShowOutputPanal;
  16.         private System.Windows.Forms.TabControl tabControl1;
  17.         private System.Windows.Forms.TabPage tabPage1;
  18.         private System.Windows.Forms.Button btnCancel;
  19.         private System.Windows.Forms.ComboBox comboBox1;
  20.         private System.Windows.Forms.TabPage tabPage2;
  21.         private System.Windows.Forms.TextBox textBox1;
  22.         private System.Windows.Forms.Button btnOK;
  23.         private System.Windows.Forms.Label label2;
  24.         private System.Windows.Forms.Label label1;
  25.         private System.Windows.Forms.TabPage ppGeneral;
  26.         private System.Windows.Forms.PictureBox pictureBox1;
  27.         private System.Windows.Forms.Label label3;
  28.         private System.Windows.Forms.PictureBox pictureBox3;
  29.         private System.Windows.Forms.LinkLabel linkLabel1;
  30.         private System.Windows.Forms.CheckBox checkBox2;
  31.         private System.Windows.Forms.PictureBox pictureBox2;
  32.         private System.Windows.Forms.CheckBox checkBox1;
  33.         private System.Windows.Forms.TabPage tabPage3;
  34.         private System.Windows.Forms.TextBox textBox2;
  35.         private ISidebar m_sidebar;
  36.         private string dicl2;
  37.         /// <summary>
  38.         /// Required designer variable.
  39.         /// </summary>
  40.         private System.ComponentModel.Container components = null;
  41.  
  42.         public CPropertiesDlg(ISidebar sidebar)
  43.         {
  44.             //
  45.             // Required for Windows Form Designer support
  46.             //
  47.             m_sidebar = sidebar; 
  48.             InitializeComponent();
  49.             sidebar.GetTranslator().TranslateDialog2(new DialogTranslator(this),"NotesEditor.Properties");
  50.           
  51.         }
  52.  
  53.  
  54.  
  55.         /// <summary>
  56.         /// Clean up any resources being used.
  57.         /// </summary>
  58.         protected override void Dispose( bool disposing )
  59.         {
  60.             if( disposing )
  61.             {
  62.                 if(components != null)
  63.                 {
  64.                     components.Dispose();
  65.                 }
  66.             }
  67.             base.Dispose( disposing );
  68.         }
  69.  
  70.   public void setdicl(string dicl3)
  71.         {
  72.             this.dicl2 = dicl3;
  73.         }
  74.         
  75.          public void settw(bool twt)
  76.         {
  77.             this.checkBox2.Checked = twt;
  78.         }
  79.  
  80.  public string dicl
  81.         {
  82.             get
  83.             {
  84.             return dicl2;
  85.             }
  86.         }
  87.  
  88.         public bool GetShowNotesCounter()
  89.         {
  90.             return chkbShowOutputPanal.Checked;
  91.         }
  92.         
  93.         public bool twt()
  94.         {
  95.             return checkBox2.Checked;
  96.         }
  97.  
  98.         public void SetShowNotesCounter(bool bShowNotesCounter)
  99.         {
  100.             chkbShowOutputPanal.Checked = bShowNotesCounter;
  101.         }
  102.         
  103.          public bool dn()
  104.         {
  105.             return checkBox1.Checked;
  106.         }
  107.  
  108.         public void setdn(bool sdn)
  109.         {
  110.             checkBox1.Checked = sdn;
  111.         }
  112.           
  113.            public void setcb(object sender, System.EventArgs e)
  114.         {
  115.          int ind = this.comboBox1.Items.IndexOf(dicl2);
  116.             this.comboBox1.SelectedIndex = ind;
  117.             if(this.comboBox1.SelectedIndex==-1)
  118.             {
  119.                  ind = this.comboBox1.Items.IndexOf(m_sidebar.GetTranslator().TranslateCommand("White"));
  120.                             this.comboBox1.SelectedIndex = ind;
  121.             }
  122.         }
  123.         #region Windows Form Designer generated code
  124.         /// <summary>
  125.         /// Required method for Designer support - do not modify
  126.         /// the contents of this method with the code editor.
  127.         /// </summary>
  128.         private void InitializeComponent() {
  129.             System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(CPropertiesDlg));
  130.             this.textBox2 = new System.Windows.Forms.TextBox();
  131.             this.tabPage3 = new System.Windows.Forms.TabPage();
  132.             this.checkBox1 = new System.Windows.Forms.CheckBox();
  133.             this.pictureBox2 = new System.Windows.Forms.PictureBox();
  134.             this.checkBox2 = new System.Windows.Forms.CheckBox();
  135.             this.linkLabel1 = new System.Windows.Forms.LinkLabel();
  136.             this.pictureBox3 = new System.Windows.Forms.PictureBox();
  137.             this.label3 = new System.Windows.Forms.Label();
  138.             this.pictureBox1 = new System.Windows.Forms.PictureBox();
  139.             this.ppGeneral = new System.Windows.Forms.TabPage();
  140.             this.label1 = new System.Windows.Forms.Label();
  141.             this.label2 = new System.Windows.Forms.Label();
  142.             this.btnOK = new System.Windows.Forms.Button();
  143.             this.textBox1 = new System.Windows.Forms.TextBox();
  144.             this.tabPage2 = new System.Windows.Forms.TabPage();
  145.             this.comboBox1 = new System.Windows.Forms.ComboBox();
  146.             this.btnCancel = new System.Windows.Forms.Button();
  147.             this.tabPage1 = new System.Windows.Forms.TabPage();
  148.             this.tabControl1 = new System.Windows.Forms.TabControl();
  149.             this.chkbShowOutputPanal = new System.Windows.Forms.CheckBox();
  150.             this.tabPage3.SuspendLayout();
  151.             this.ppGeneral.SuspendLayout();
  152.             this.tabPage2.SuspendLayout();
  153.             this.tabPage1.SuspendLayout();
  154.             this.tabControl1.SuspendLayout();
  155.             this.SuspendLayout();
  156.             // 
  157.             // textBox2
  158.             // 
  159.             this.textBox2.Location = new System.Drawing.Point(8, 56);
  160.             this.textBox2.Multiline = true;
  161.             this.textBox2.Name = "textBox2";
  162.             this.textBox2.ReadOnly = true;
  163.             this.textBox2.ScrollBars = System.Windows.Forms.ScrollBars.Both;
  164.             this.textBox2.Size = new System.Drawing.Size(256, 96);
  165.             this.textBox2.TabIndex = 6;
  166.             this.textBox2.Text = "";
  167.             // 
  168.             // tabPage3
  169.             // 
  170.             this.tabPage3.Controls.Add(this.linkLabel1);
  171.             this.tabPage3.Controls.Add(this.textBox2);
  172.             this.tabPage3.Controls.Add(this.label3);
  173.             this.tabPage3.Controls.Add(this.pictureBox3);
  174.             this.tabPage3.Location = new System.Drawing.Point(4, 22);
  175.             this.tabPage3.Name = "tabPage3";
  176.             this.tabPage3.Size = new System.Drawing.Size(272, 254);
  177.             this.tabPage3.TabIndex = 3;
  178.             this.tabPage3.Text = "About";
  179.             // 
  180.             // checkBox1
  181.             // 
  182.             this.checkBox1.FlatStyle = System.Windows.Forms.FlatStyle.System;
  183.             this.checkBox1.Location = new System.Drawing.Point(8, 32);
  184.             this.checkBox1.Name = "checkBox1";
  185.             this.checkBox1.Size = new System.Drawing.Size(328, 24);
  186.             this.checkBox1.TabIndex = 1;
  187.             this.checkBox1.Text = "Show a warning message before deleting a note";
  188.             // 
  189.             // pictureBox2
  190.             // 
  191.             this.pictureBox2.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox2.Image")));
  192.             this.pictureBox2.Location = new System.Drawing.Point(208, 200);
  193.             this.pictureBox2.Name = "pictureBox2";
  194.             this.pictureBox2.Size = new System.Drawing.Size(48, 48);
  195.             this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
  196.             this.pictureBox2.TabIndex = 6;
  197.             this.pictureBox2.TabStop = false;
  198.             // 
  199.             // checkBox2
  200.             // 
  201.             this.checkBox2.FlatStyle = System.Windows.Forms.FlatStyle.System;
  202.             this.checkBox2.Location = new System.Drawing.Point(8, 56);
  203.             this.checkBox2.Name = "checkBox2";
  204.             this.checkBox2.Size = new System.Drawing.Size(328, 24);
  205.             this.checkBox2.TabIndex = 2;
  206.             this.checkBox2.Text = "Enable text wrap";
  207.             // 
  208.             // linkLabel1
  209.             // 
  210.             this.linkLabel1.Location = new System.Drawing.Point(16, 160);
  211.             this.linkLabel1.Name = "linkLabel1";
  212.             this.linkLabel1.Size = new System.Drawing.Size(256, 16);
  213.             this.linkLabel1.TabIndex = 7;
  214.             this.linkLabel1.TabStop = true;
  215.             this.linkLabel1.Text = "I'll be glad to get feedback from you.Click here.";
  216.             this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabel1LinkClicked);
  217.             // 
  218.             // pictureBox3
  219.             // 
  220.             this.pictureBox3.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox3.Image")));
  221.             this.pictureBox3.Location = new System.Drawing.Point(96, 184);
  222.             this.pictureBox3.Name = "pictureBox3";
  223.             this.pictureBox3.Size = new System.Drawing.Size(72, 72);
  224.             this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
  225.             this.pictureBox3.TabIndex = 6;
  226.             this.pictureBox3.TabStop = false;
  227.             // 
  228.             // label3
  229.             // 
  230.             this.label3.Font = new System.Drawing.Font("Times New Roman", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  231.             this.label3.Location = new System.Drawing.Point(8, 0);
  232.             this.label3.Name = "label3";
  233.             this.label3.Size = new System.Drawing.Size(256, 56);
  234.             this.label3.TabIndex = 5;
  235.             this.label3.Text = "Notes Editor Panel for Desktop Sidebar";
  236.             this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
  237.             // 
  238.             // pictureBox1
  239.             // 
  240.             this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
  241.             this.pictureBox1.Location = new System.Drawing.Point(208, 200);
  242.             this.pictureBox1.Name = "pictureBox1";
  243.             this.pictureBox1.Size = new System.Drawing.Size(48, 48);
  244.             this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
  245.             this.pictureBox1.TabIndex = 5;
  246.             this.pictureBox1.TabStop = false;
  247.             // 
  248.             // ppGeneral
  249.             // 
  250.             this.ppGeneral.Controls.Add(this.checkBox2);
  251.             this.ppGeneral.Controls.Add(this.checkBox1);
  252.             this.ppGeneral.Controls.Add(this.chkbShowOutputPanal);
  253.             this.ppGeneral.Controls.Add(this.pictureBox1);
  254.             this.ppGeneral.Location = new System.Drawing.Point(4, 22);
  255.             this.ppGeneral.Name = "ppGeneral";
  256.             this.ppGeneral.Size = new System.Drawing.Size(272, 254);
  257.             this.ppGeneral.TabIndex = 0;
  258.             this.ppGeneral.Text = "General";
  259.             // 
  260.             // label1
  261.             // 
  262.             this.label1.Location = new System.Drawing.Point(8, 8);
  263.             this.label1.Name = "label1";
  264.             this.label1.Size = new System.Drawing.Size(240, 16);
  265.             this.label1.TabIndex = 0;
  266.             this.label1.Text = "Select the default text color of a note:";
  267.             // 
  268.             // label2
  269.             // 
  270.             this.label2.Font = new System.Drawing.Font("Times New Roman", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
  271.             this.label2.Location = new System.Drawing.Point(24, 8);
  272.             this.label2.Name = "label2";
  273.             this.label2.Size = new System.Drawing.Size(256, 32);
  274.             this.label2.TabIndex = 0;
  275.             this.label2.Text = "Notes Editor Panel-Help";
  276.             // 
  277.             // btnOK
  278.             // 
  279.             this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
  280.             this.btnOK.FlatStyle = System.Windows.Forms.FlatStyle.System;
  281.             this.btnOK.Location = new System.Drawing.Point(128, 296);
  282.             this.btnOK.Name = "btnOK";
  283.             this.btnOK.TabIndex = 1;
  284.             this.btnOK.Text = "OK";
  285.             // 
  286.             // textBox1
  287.             // 
  288.             this.textBox1.Location = new System.Drawing.Point(8, 40);
  289.             this.textBox1.Multiline = true;
  290.             this.textBox1.Name = "textBox1";
  291.             this.textBox1.ReadOnly = true;
  292.             this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Both;
  293.             this.textBox1.Size = new System.Drawing.Size(256, 208);
  294.             this.textBox1.TabIndex = 1;
  295.             this.textBox1.Text = "";
  296.             // 
  297.             // tabPage2
  298.             // 
  299.             this.tabPage2.Controls.Add(this.textBox1);
  300.             this.tabPage2.Controls.Add(this.label2);
  301.             this.tabPage2.Location = new System.Drawing.Point(4, 22);
  302.             this.tabPage2.Name = "tabPage2";
  303.             this.tabPage2.Size = new System.Drawing.Size(272, 254);
  304.             this.tabPage2.TabIndex = 2;
  305.             this.tabPage2.Text = "Help";
  306.             // 
  307.             // comboBox1
  308.             // 
  309.                         this.comboBox1.Items.AddRange(new object[] {
  310.                         m_sidebar.GetTranslator().TranslateCommand("Black"),
  311.                         m_sidebar.GetTranslator().TranslateCommand("Red"),
  312.                         m_sidebar.GetTranslator().TranslateCommand("Green"),
  313.                         m_sidebar.GetTranslator().TranslateCommand("Yellow"),
  314.                         m_sidebar.GetTranslator().TranslateCommand("Blue"),
  315.                         m_sidebar.GetTranslator().TranslateCommand("Purple"),
  316.                         m_sidebar.GetTranslator().TranslateCommand("Orange"),
  317.                         m_sidebar.GetTranslator().TranslateCommand("White"),
  318.                         m_sidebar.GetTranslator().TranslateCommand("Turquoise")});
  319.             this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  320.             this.comboBox1.Location = new System.Drawing.Point(56, 40);
  321.             this.comboBox1.Name = "comboBox1";
  322.             this.comboBox1.Size = new System.Drawing.Size(104, 21);
  323.             this.comboBox1.TabIndex = 4;
  324.             this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.ComboBox1SelectedIndexChanged);
  325.             // 
  326.             // btnCancel
  327.             // 
  328.             this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
  329.             this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System;
  330.             this.btnCancel.Location = new System.Drawing.Point(208, 296);
  331.             this.btnCancel.Name = "btnCancel";
  332.             this.btnCancel.TabIndex = 2;
  333.             this.btnCancel.Text = "Cancel";
  334.             // 
  335.             // tabPage1
  336.             // 
  337.             this.tabPage1.Controls.Add(this.comboBox1);
  338.             this.tabPage1.Controls.Add(this.label1);
  339.             this.tabPage1.Controls.Add(this.pictureBox2);
  340.             this.tabPage1.Location = new System.Drawing.Point(4, 22);
  341.             this.tabPage1.Name = "tabPage1";
  342.             this.tabPage1.Size = new System.Drawing.Size(272, 254);
  343.             this.tabPage1.TabIndex = 1;
  344.             this.tabPage1.Text = "Notes";
  345.             // 
  346.             // tabControl1
  347.             // 
  348.             this.tabControl1.Controls.Add(this.ppGeneral);
  349.             this.tabControl1.Controls.Add(this.tabPage1);
  350.             this.tabControl1.Controls.Add(this.tabPage2);
  351.             this.tabControl1.Controls.Add(this.tabPage3);
  352.             this.tabControl1.Location = new System.Drawing.Point(8, 8);
  353.             this.tabControl1.Name = "tabControl1";
  354.             this.tabControl1.SelectedIndex = 0;
  355.             this.tabControl1.Size = new System.Drawing.Size(280, 280);
  356.             this.tabControl1.TabIndex = 4;
  357.             this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.setcb);
  358.             // 
  359.             // chkbShowOutputPanal
  360.             // 
  361.             this.chkbShowOutputPanal.FlatStyle = System.Windows.Forms.FlatStyle.System;
  362.             this.chkbShowOutputPanal.Location = new System.Drawing.Point(8, 8);
  363.             this.chkbShowOutputPanal.Name = "chkbShowOutputPanal";
  364.             this.chkbShowOutputPanal.Size = new System.Drawing.Size(328, 24);
  365.             this.chkbShowOutputPanal.TabIndex = 0;
  366.             this.chkbShowOutputPanal.Text = "Show notes counter";
  367.             // 
  368.             // CPropertiesDlg
  369.             // 
  370.             this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  371.             this.ClientSize = new System.Drawing.Size(298, 328);
  372.             this.Controls.Add(this.tabControl1);
  373.             this.Controls.Add(this.btnCancel);
  374.             this.Controls.Add(this.btnOK);
  375.             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
  376.             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
  377.             this.MaximizeBox = false;
  378.             this.Name = "CPropertiesDlg";
  379.             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
  380.             this.Text = "Notes Editor Properties";
  381.             this.tabPage3.ResumeLayout(false);
  382.             this.ppGeneral.ResumeLayout(false);
  383.             this.tabPage2.ResumeLayout(false);
  384.             this.tabPage1.ResumeLayout(false);
  385.             this.tabControl1.ResumeLayout(false);
  386.             this.ResumeLayout(false);
  387.         }
  388.         #endregion
  389.  
  390. void ComboBox1SelectedIndexChanged(object sender, System.EventArgs e)
  391. {
  392.     this.dicl2 = this.comboBox1.SelectedItem.ToString();
  393. }
  394.  
  395.  
  396.  
  397. void LinkLabel1LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
  398. {
  399.      System.Diagnostics.Process.Start("http://www.desktopsidebar.com/forums/index.php?showtopic=1925&st=0&#entry11261");    
  400. }
  401.  
  402.     }
  403. }
  404.